From: Jasper St. Pierre Date: Tue, 28 Jan 2014 17:09:35 +0000 (-0500) Subject: appDisplay: Properly check for TerminalEmulator in the Categories key X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~2873 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=887a21afb97aaa35;p=gnome-shell.git appDisplay: Properly check for TerminalEmulator in the Categories key get_categories() returns an unparsed string, not a list of categories. We need to parse the list by splitting on ';' to deterine whether the actual 'TerminalEmulator' category is in the list, rather than something like 'X-GNOME-TerminalEmulator'. It's an edge case, but I need to split the list properly for the new folders, so I might as well fix this. https://bugzilla.gnome.org/show_bug.cgi?id=723179 --- diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index b30e49d1d..921d83b07 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -46,11 +46,18 @@ const INDICATORS_ANIMATION_MAX_TIME = 0.75; const PAGE_SWITCH_TRESHOLD = 0.2; const PAGE_SWITCH_TIME = 0.3; +function _getCategories(info) { + let categoriesStr = info.get_categories(); + if (!categoriesStr) + return []; + return categoriesStr.split(';'); +} + function _isTerminal(app) { let info = app.get_app_info(); if (!info) return false; - let categories = info.get_categories() || []; + let categories = _getCategories(info); return categories.indexOf('TerminalEmulator') > -1; }